package com.zt.event.event.listener;

import com.zt.event.enums.ApplicationStatusEnums;
import com.zt.event.service.status.event.CustomsApplicationStartedEvent;
import com.zt.event.service.status.listener.DefaultListenerProcess;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * @author system
 * 服务启动就绪
 */
@Slf4j
public class ServiceStartedListener extends DefaultListenerProcess implements ApplicationListener<CustomsApplicationStartedEvent>{

    @Override
    public void onApplicationEvent(CustomsApplicationStartedEvent event) {
        log.info("应用启动成功");
        String response = defaultHandleMessage(ApplicationStatusEnums.SERVER_STARTED, "无", context, event.getCostTime());
        if (response == null) {
            log.info("NOTICE_URL 参数为空, 不参与发送");
        } else {

            log.info("send success data:{}", response);
        }
    }
}
